package TestModel;

import java.util.LinkedList;
import java.util.Random;

import DataModel.CommonLibrary.CommonDefs.*;
import DataModel.ConnectivityManager.CConnectivityManager;
import DataModel.ConnectivityManager.CRectangleConnectivityGraph;
import DataModel.LayoutManager.CRectangle;
import junit.framework.TestCase;

public class ConnectivityTest extends TestCase {

	/***************************************************/
	/****** Members ************************************/
	/***************************************************/
	LinkedList<CRectangle> recsList = new LinkedList<CRectangle>();
	CRectangle rec0 = new CRectangle(2,5,4,10,Layer.Metal1,0);
	CRectangle rec1 = new CRectangle(3,6,10,11,Layer.Metal2,1);
	CRectangle rec2 = new CRectangle(8,7,9,8,Layer.Via1_2,2);
	CRectangle rec3 = new CRectangle(7,4,10,12,Layer.Metal1,3);
	CRectangle rec4 = new CRectangle(6,2,11,5,Layer.Metal3,4);
	CRectangle rec5 = new CRectangle(3,1,12,3,Layer.Metal1,5);
	CConnectivityManager m_connectMan;
	
	/***************************************************/
	/****** C'tors *************************************/
	/***************************************************/
	public ConnectivityTest()
	{
		recsList.add(rec0);
		recsList.add(rec1);
		recsList.add(rec2);
		recsList.add(rec3);
		recsList.add(rec4);
		recsList.add(rec5);
		m_connectMan = new CConnectivityManager(recsList);
	}
	
	/***************************************************/
	/****** Tests **************************************/
	/***************************************************/
	// Connectivity Manager: Are Connected test
	public void testAreConnected() 
	{
		assertEquals(true, m_connectMan.AreConnected(1, 3));
		assertEquals(true, m_connectMan.AreConnected(1, 2));
		assertEquals(true, m_connectMan.AreConnected(2, 3));
	}

}





















